{extend name="public/world"}
{block name="style"}
<link rel="stylesheet" href="/static/style/project.css?t={$Think.config.hello.version}" media="all">
{/block}
{block name="container"}
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-header">
            <i class="layui-icon layui-icon-export" style="font-size: 16px;position: initial;line-height: 42px;margin: 0 5px 0 -5px;"></i>
            {$pro.name}
            <i class="layui-icon layui-icon-about tooltip" style="font-size: 16px;position: initial;line-height: 42px;margin: 0 0 0 5px;cursor: pointer;" lay-text="{$pro.description}"></i>
            <span class="pro-status status{$pro.status}">{$pro.statustext}</span>
            {if isset($sonAuth['show'])}
            <div class="layuiadmin-btn-group">
                {if $success_status && in_array($uid,$pro_owners) }
                <a href="{:url('/projects.Produce/show')}?id={$pro.id}&op=success" class="layui-btn layui-btn-sm layui-btn-radius layui-btn-danger j-ajax" confirm="确认项目已经全部完成了吗？">提交完成</a>
                {/if}
                {if $pro.status != 2 && in_array($uid,$pro_owners) }
                <a href="{:url('/projects.Produce/show')}?id={$pro.id}&column_id=1&swimlane_id=1&op=add" class="layui-btn layui-btn-sm layui-btn-radius j-iframe-pop" lxb-data="{width: '700px', height: '450px'}" title="添加任务">添加任务</a>
                {/if}
            </div>
            {/if}
        </div>
        <div class="layui-card-body" style="padding: 0;">
            <div class="layui-form layui-tab layui-tab-card">
                <ul class="layui-tab-title">
                    <li><a href="{:url('/projects.Produce/show')}?id={$pro.id}&op=basic">概况</a></li>
                    <li class="layui-this">操纵台</li>
                </ul>
                <div class="dropdown-component project-setting">
                    <div class="dropdown">
                        <a href="#" class="dropdown-menu action-menu">
                            <i class="layui-icon layui-icon-more-vertical"></i> 菜单
                            <i class="layui-icon layui-icon-triangle-d"></i>
                        </a>
                        <ul>
                            <li>
                                {if $collapsed }
                                <i class="layui-icon layui-icon-screen-full"></i>
                                <a href="{:url('/projects.Produce/show')}?id={$pro.id}&to=0&op=change&event=collapsed" class="j-ajax" layui-msg="no" title="展开任务">展开任务</a>
                                {else /}
                                <i class="layui-icon layui-icon-screen-restore"></i>
                                <a href="{:url('/projects.Produce/show')}?id={$pro.id}&to=1&op=change&event=collapsed" class="j-ajax" layui-msg="no" title="收缩任务">收缩任务</a>
                                {/if}
                            </li>
                            <li>
                                {if $owner_id_only }
                                <i class="layui-icon layui-icon-auz"></i>
                                <a href="{:url('/projects.Produce/show')}?id={$pro.id}&to=0&op=change&event=only" class="j-ajax" layui-msg="no" title="查看全部">查看全部</a>
                                {else /}
                                <i class="layui-icon layui-icon-auz"></i>
                                <a href="{:url('/projects.Produce/show')}?id={$pro.id}&to=1&op=change&event=only" class="j-ajax" layui-msg="no" title="只看我的">只看我的</a>
                                {/if}
                            </li>
                            {if $pro.status != 2 && in_array($uid,$pro_owners)}
                            <li>
                                <i class="layui-icon layui-icon-transfer"></i>
                                <a href="{:url('/projects.Produce/show')}?id={$pro.id}&op=swimlane" class="b-iframe-pop" title="泳道管理">泳道管理</a>
                            </li>
                            {/if}
                        </ul>
                    </div>
                </div>
                <div class="layui-tab-content">
                    <div class="layui-tab-item layui-show" id="board-container">
                        <table id="board" class="board-project-{$pro.id}" data-project-id="{$pro.id}">
                            {foreach $tasks.swimlanes as $tk=>$task }
                            {if $tk == 0 }
                            <!-- 栏目title -->
                            <tr class="board-swimlane-columns-{$tk}">
                                {foreach $task.columns as $ck=>$column }
                                <th class="board-column-header board-column-header-{$pro.id}-{$ck}" data-project-id="{$pro.id}" data-column-id="{$ck}">
                                    <!-- 通道折叠 -->
                                    <div class="board-column-collapsed">
                                        <small class="board-column-header-task-count" title="显示任务栏">
                                            <span>{$tasks['column'.$ck]}</span>
                                        </small>
                                    </div>
                                    <!-- 通道展开 -->
                                    <div class="board-column-expanded">
                                        {if $ck == 1 && $pro.status != 2 && in_array($uid,$pro_owners) }
                                        <div class="board-add-icon">
                                            <a href="{:url('/projects.Produce/show')}?id={$pro.id}&column_id={$ck}&swimlane_id={$tk}&op=add" class="j-iframe-pop" lxb-data="{width: '700px', height: '450px'}" title='创建新任务' >+</a>
                                        </div>
                                        {/if}
                                        {if count($tasks.swimlanes) > 1 && $tasks['column'.$ck] > 0 }
                                        <span title="此任务栏下的任务数（跨泳道）" class="board-column-header-task-count">
                                            (<span>{$tasks['column'.$ck]}</span>)
                                        </span>
                                        {/if}
                                        <span class="board-column-title">
                                            <span class="dropdown">
                                                <a href="javascript:;" class="dropdown-menu">{$column.title} <i class="layui-icon layui-icon-triangle-d"></i></a>
                                                <ul>
                                                    <li>
                                                        <i class="layui-icon layui-icon-shrink-right"></i>
                                                        <a href="javascript:;" class="board-toggle-column-view" data-project-id="{$pro.id}" data-column-id="{$ck}">隐藏任务栏</a>
                                                    </li>
                                                </ul>
                                            </span>
                                        </span>
                                        <span title="任务数" class="board-column-header-task-count">
                                            (<span>{$column.column}</span>)
                                        </span>
                                    </div>
                                </th>
                                {/foreach}
                            </tr>
                            {/if}
                            {if count($tasks.swimlanes) > 1 }
                            <!-- 泳道 -->
                            <tr id="swimlane-{$tk}">
                                <th class="board-swimlane-header" colspan="4">
                                    <a href="javascript:;" class="board-swimlane-toggle" data-swimlane-id="{$tk}">
                                        <i class="layui-icon layui-icon-up  hide-icon-swimlane-{$tk}" title="收起泳道"></i>
                                        <i class="layui-icon layui-icon-down show-icon-swimlane-{$tk}" title="展开泳道" style="display: none"></i>
                                    </a>
                                    {$task.swim.name}
                                    {notempty name="task.swim.description" }
                                    <span title="描述" class="tooltip" lay-text="{$task.swim.description}">
                                        <i class="layui-icon layui-icon-about"></i>
                                    </span>
                                    {/notempty}
                                    <span title="任务数" class="board-column-header-task-count">
                                        ({$task.column})
                                    </span>
                                </th>
                            </tr>
                            {/if}
                            {if $tk > 0 }
                            <!-- 栏目 titles -->
                            <tr class="board-swimlane-columns-{$tk}">
                                {foreach $task.columns as $ck=>$column }
                                <th class="board-column-header board-column-header-{$pro.id}-{$ck}" data-column-id="{$ck}">
                                    <!-- 通道折叠 -->
                                    <div class="board-column-collapsed">
                                        <small class="board-column-header-task-count" title="显示任务栏">
                                            <span>{$tasks['column'.$ck]}</span>
                                        </small>
                                    </div>
                                    <!-- 通道展开 -->
                                    <div class="board-column-expanded">
                                        {if $ck == 1 && $pro.status != 2 && in_array($uid,$pro_owners) }
                                        <div class="board-add-icon">
                                            <a href="{:url('/projects.Produce/show')}?id={$pro.id}&column_id={$ck}&swimlane_id={$tk}&op=add" class="j-iframe-pop" lxb-data="{width: '700px', height: '450px'}" title='创建新任务' >+</a>
                                        </div>
                                        {/if}
                                        <span class="board-column-title">
                                            <span class="dropdown">
                                                <a href="javascript:;" class="dropdown-menu">{$column.title} <i class="layui-icon layui-icon-triangle-d"></i></a>
                                                <ul>
                                                    <li>
                                                        <i class="layui-icon layui-icon-shrink-right"></i>
                                                        <a href="javascript:;" class="board-toggle-column-view" data-project-id="{$pro.id}" data-column-id="{$ck}">隐藏任务栏</a>
                                                    </li>
                                                </ul>
                                            </span>
                                        </span>
                                        <span title="任务数" class="board-column-header-task-count">
                                            (<span>{$column.column}</span>)
                                        </span>
                                    </div>
                                </th>
                                {/foreach}
                            </tr>
                            {/if}
                            <!-- 任务栏 -->
                            <tr class="board-swimlane board-swimlane-tasks-{$tk}">
                                {foreach $task.columns as $ck=>$column }
                                <td class="board-column-{$pro.id}-{$ck}">
                                    <!-- 任务展示栏 -->
                                    <div class="board-task-list board-column-expanded sortable-column" data-column-id="{$ck}" data-swimlane-id="{$tk}">
                                        {foreach $column.lists as $lk=>$ite }
                                        <div class="task-board{if $ite.status==2 || $ite.owner_id!=$uid} no-sortable{/if} draggable-item{if $ite.is_delete} task-board-recent{/if} color-deep{$ite.deep}" data-task-id="{$ite.id}" data-column-id="{$ite.column_id}" data-swimlane-id="{$ite.swimlane_id}" data-position="{$ite.position}" data-owner-id="{$ite.owner_id}" data-task-url="{:url('/projects.Produce/show')}?id={$pro.id}&task_id={$ite.id}&op=show">
                                            <div class="task-board-expanded">
                                                <div class="task-board-saving-icon" style="display: none;"><i class="layui-icon layui-icon-loading layui-icon layui-anim layui-anim-rotate layui-anim-loop" style="font-size: 25px;color: #c54f31;"></i></div>
                                                <div class="dropdown">
                                                    <a href="javascript:;" class="dropdown-menu">#{$ite.zid} <i class="layui-icon layui-icon-triangle-d"></i></a>
                                                    {if ($ite.status == 0 && in_array($uid,$pro_owners)) || ($ite.owner_id == $uid) || ($ck < 3 && in_array($uid,$pro_owners)) }
                                                    <ul>
                                                        {if $ite.status == 0 && in_array($uid,$pro_owners) }
                                                        <li>
                                                            <i class="layui-icon layui-icon-edit"></i>
                                                            <a href="{:url('/projects.Produce/show')}?id={$pro.id}&task_id={$ite.id}&op=edit" class="j-iframe-pop" lxb-data="{width: '700px', height: '450px'}" title='修改任务'>修改任务</a>
                                                        </li>
                                                        {/if}
                                                        {if $ite.owner_id == $uid }
                                                        <li>
                                                            <i class="layui-icon layui-icon-dialogue"></i>
                                                            <a href="{:url('/projects.Produce/show')}?id={$pro.id}&task_id={$ite.id}&op=log" class="j-iframe-pop" lxb-data="{width: '560px', height: '250px'}" title='添加日志' >添加日志</a>
                                                        </li>
                                                        {/if}
                                                        {if $ck < 3 && in_array($uid,$pro_owners) }
                                                        <li>
                                                            <i class="layui-icon layui-icon-close"></i>
                                                            <a href="{:url('/projects.Produce/show')}?id={$pro.id}&task_id={$ite.id}&op=del" class="j-ajax" confirm='你确定要关闭该任务吗？关闭后将不再显示该任务' >关闭该任务</a>
                                                        </li>
                                                        {/if}
                                                    </ul>
                                                    {/if}
                                                </div>
                                                {if $collapsed }
                                                <span title="{$ite.owner_name}">{$ite.owner_name}</span>
                                                -
                                                <a href="{:url('/projects.Produce/show')}?id={$pro.id}&task_id={$ite.id}&op=show" class="task-board-collapsed-title tooltip" title="{$ite.title}">{$ite.title}</a>
                                                {else /}
                                                <div class="task-board-avatars">
                                                    <span class="task-board-change-assignee">
                                                        <div class="avatar avatar-20 avatar-inline">
                                                            <div class="avatar-letter" style="background-color: {$ite.owner_avatar}" title="{$ite.owner_name}">{$ite.owner_name}</div>
                                                        </div>
                                                    </span>
                                                </div>
                                                <div class="task-board-title">
                                                    <a href="{:url('/projects.Produce/show')}?id={$pro.id}&task_id={$ite.id}&op=show" class="" title='查看该任务' >{$ite.title}</a>
                                                </div>
                                                <div class="task-board-icons">
                                                    <span class="task-time-estimated" title="实际/预计工时">
                                                        {$ite.estimated}
                                                    </span>
                                                    {if $ite.end_date }
                                                    <span class="task-board-date task-board-date-overdue">
                                                        <i class="layui-icon layui-icon-date"></i>
                                                        {$ite.end_date}
                                                    </span>
                                                    {/if}
                                                    {if $ite.task_links }
                                                    <span title="关联" class="tooltip" data-href=""><i class="layui-icon layui-icon-link"></i>{$ite.task_links}</span>
                                                    {/if}
                                                    <span class="task-board-deep{$ite.deep}" title="任务优先级">{$ite.deep_name}</span>
                                                    {if $ite.status == 0}
                                                    <div class="task-board-age">
                                                        <span title="任务存在天数" class="task-board-age-total">{:date_age($ite.create_at)}</span>
                                                        <span title="在此栏目的天数" class="task-board-age-column">{:date_age($ite.moved_at)}</span>
                                                    </div>
                                                    {else /}
                                                    <span class="task-board-closed">
                                                        {if $ite.status == 2}
                                                        <i class="layui-icon layui-icon-ok-circle" style="font-size: 12px; color: #009688;"></i>
                                                        {/if}
                                                        完成
                                                    </span>
                                                    {/if}
                                                </div>
                                                {/if}
                                            </div>
                                        </div>
                                        {/foreach}
                                    </div>
                                    <!-- 隐藏任务栏 -->
                                    <div class="board-column-collapsed">
                                        <div class="board-rotation-wrapper">
                                            <div class="board-column-title board-rotation board-toggle-column-view-sd" data-project-id="{$pro.id}" data-column-id="{$ck}" title="显示任务栏">
                                                <i class="layui-icon layui-icon-add-circle tooltip" title="{$column.title}"></i> {$column.title}
                                            </div>
                                        </div>
                                    </div>
                                </td>
                                {/foreach}
                            </tr>
                            {/foreach}
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script src="/static/js/jquery-1.10.2.min.js"></script>
<script src="/static/js/jquery-ui.min.js"></script>
<script>
    layui.use(['form'], function() {
        var $ = layui.jquery;
        var refreshDom = true;
        $("#App_tabsheader>li", parent.document).click(function(){
            if( typeof(refreshDom) != 'undefined' && refreshDom ) {
                window.location.reload();
            }
        });
        $('.tooltip').on('mouseover', function() {
            var that = this;
            var msg = $(that).attr('lay-text') || $(that).attr('title');
            layer.tips(msg, that, {
                time : 0,
                tips : [2, '#5a5a5a']
            });
        }).on('mouseout', function() {
            layer.closeAll('tips');
        });

        //加载中
        var changeTaskState = function(t) {
            var e = $("div[data-task-id=" + t + "]");
            e.addClass("task-board-saving-state"),
                e.find(".task-board-saving-icon").show();
        }
        //提交拖拽排序
        var save = function(taskId, srcColumnId, dstColumnId, position, swimlaneId) {
            $.ajax({
                cache: false,
                url: "{:url('/projects.Produce/show')}?id={$pro.id}&op=board",
                contentType: "application/json",
                type: "POST",
                processData: false,
                data: JSON.stringify({
                    "task_id": taskId,
                    "src_column_id": srcColumnId,
                    "dst_column_id": dstColumnId,
                    "swimlane_id": swimlaneId,
                    "position": position
                }),
                success: function(res) {
                    if(res.code == 1) {
                        document.location.reload(!0);
                    } else {
                        layer.msg(res.msg);
                        setTimeout(function() {
                            document.location.reload(!0);
                        }, 1000);
                    }
                },
                error: function() {
                    layer.msg('网络错误');
                },
                statusCode: {
                    403: function(data) {
                        layer.msg('网络错误');
                        document.location.reload(!0);
                    }
                }
            });
        }
        //拖动事件
        $(".sortable-column").sortable({
            forcePlaceholderSize: !0,
            tolerance: "pointer",
            connectWith: ".sortable-column",
            helper: "original",//拖拽元素时，显示一个辅助的元素。可选值：'original', 'clone'
            cancel: ".no-sortable",//禁止拖动的元素
            revert: true,//移入后的动画效果
            scroll: false,//拖动到页面边缘时，会自动滚动
            containment: "table",//禁止区域边界
            cursor: "move",//移动时候鼠标样式
            opacity: 0.9, //拖拽过程中透明度
            placeholder: "draggable-placeholder",//占位符className，设置一个样式
            items: ".draggable-item",//哪些元素是可以拖拽的
            stop: function (e, i) {
                var o = i.item
                    , a = o.attr("data-task-id")//任务ID
                    , n = o.attr("data-position")//排序
                    , r = o.attr("data-column-id")//栏目ID
                    , s = o.attr("data-swimlane-id")//泳道ID
                    , l = o.parent().attr("data-column-id")//进入的栏目ID
                    , d = o.parent().attr("data-swimlane-id")//进入的泳道ID
                    , c = o.index() + 1;//当前第几位
                o.removeClass("draggable-item-selected"),
                l == r && d == s && c == n || (changeTaskState(a), save(a, r, l, c, d))
            },
            start: function (t, e) {
                e.item.addClass("draggable-item-selected");
                e.placeholder.height(e.item.height());
            }
        }).disableSelection();
        //关闭方法
        var closeDown = function() {
            $("#dropdown").remove()
        };
        //隐藏栏目
        var hideColumn = function(projectId, columnId) {
            $(".board-column-" + projectId + "-" + columnId + " .board-column-expanded").hide();
            $(".board-column-" + projectId + "-" + columnId + " .board-column-collapsed").show();
            $(".board-column-header-" + projectId + "-" + columnId + " .board-column-expanded").hide();
            $(".board-column-header-" + projectId + "-" + columnId + " .board-column-collapsed").show();

            $(".board-column-header-" + projectId + "-" + columnId).each(function() {
                $(this).removeClass("board-column-compact");
                $(this).addClass("board-column-header-collapsed");
            });

            $(".board-column-" + projectId + "-" + columnId).each(function() {
                $(this).addClass("board-column-task-collapsed");
            });

            $(".board-column-" + projectId + "-" + columnId + " .board-rotation").each(function() {
                $(this).css("width", $(".board-column-" + projectId + "-" + columnId + "").height());
            });

            localStorage.setItem("hidden_column_" + projectId + "_" + columnId, 1);
        };
        //展示栏目
        var showColumn = function(projectId, columnId) {
            $(".board-column-" + projectId + "-" + columnId + " .board-column-expanded").show();
            $(".board-column-" + projectId + "-" + columnId + " .board-column-collapsed").hide();
            $(".board-column-header-" + projectId + "-" + columnId + " .board-column-expanded").show();
            $(".board-column-header-" + projectId + "-" + columnId + " .board-column-collapsed").hide();

            $(".board-column-header-" + projectId + "-" + columnId).removeClass("board-column-header-collapsed");
            $(".board-column-" + projectId + "-" + columnId).removeClass("board-column-task-collapsed");

            if (localStorage.getItem("horizontal_scroll") == 0) {
                $(".board-column-header-" + projectId + "-" + columnId).addClass("board-column-compact");
            }
            localStorage.removeItem("hidden_column_" + projectId + "_" + columnId);
        };
        //隐藏-展开
        var toggleDom = function(projectId, columnId) {
            if (localStorage.getItem("hidden_column_" + projectId + "_" + columnId)) {
                showColumn(projectId, columnId);
            }
            else {
                hideColumn(projectId, columnId);
            }
        };
        //任务容器赋高
        $('.board-task-list').each(function () {
            $(this).css("min-height", $(this).parents('td').height());
        });
        //载入判断栏目隐藏
        $(".board-column-header").each(function () {
            var columnId = $(this).data('column-id');
            var projectId = $(this).data('project-id');
            if (localStorage.getItem("hidden_column_" + projectId + "_" + columnId)) {
                hideColumn(projectId, columnId);
            }
        });
        //弹窗菜单点击事件
        $(".dropdown-menu").click(function(e) {
            e.preventDefault(),
                e.stopImmediatePropagation(),
                closeDown();
            var i = $(this).next("ul")
                , o = $(this).offset();
            $("body").append($("<div>", {
                id: "dropdown"
            }));
            i.clone().appendTo("#dropdown");
            var a = $("#dropdown ul");
            a.addClass("dropdown-submenu-open");
            var n = a.outerHeight()
                , r = a.outerWidth();
            o.top + n - $(window).scrollTop() < $(window).height() || $(window).scrollTop() + o.top < n ? a.css("top", o.top + $(this).height()) : a.css("top", o.top - n - 5);
            o.left + r > $(window).width() ? a.css("left", o.left - r + $(this).outerWidth()) : a.css("left", o.left);

            $(".dropdown-submenu-open li").click(function(t) {
                $(t.target).is("li") && $(this).find("a:visible")[0].click();
            });
            $(".board-toggle-column-view").click(function() {
                toggleDom($(this).data('project-id'), $(this).data("column-id"));
            });
        });
        $(".board-toggle-column-view-sd").click(function() {
            toggleDom($(this).data('project-id'), $(this).data("column-id"));
        });
        var getStorageKey = function() {
            return "hidden_swimlanes_" + $("#board").data("project-id")
        }
        $(".board-swimlane-toggle").click(function(e) {
            e.preventDefault();
            var i = $(this).data("swimlane-id");
            isCollapsed(i) ? PJexpand(i) : PJcollapse(i)
        });
        var PJexpand = function(t) {
            var e = getAllCollapsed()
                , i = e.indexOf(t);
            i > -1 && e.splice(i, 1),
            localStorage.setItem(getStorageKey(), JSON.stringify(e)),
            $(".board-swimlane-columns-" + t).css("display", "table-row"),
            $(".board-swimlane-tasks-" + t).css("display", "table-row"),
            $(".hide-icon-swimlane-" + t).css("display", "inline"),
            $(".show-icon-swimlane-" + t).css("display", "none")
        }
        var PJcollapse = function(t) {
            var e = getAllCollapsed();
            e.indexOf(t) < 0 && (e.push(t), localStorage.setItem(getStorageKey(), JSON.stringify(e))),
            $(".board-swimlane-columns-" + t + ":not(:first-child)").css("display", "none"),
            $(".board-swimlane-tasks-" + t).css("display", "none"),
            $(".hide-icon-swimlane-" + t).css("display", "none"),
            $(".show-icon-swimlane-" + t).css("display", "inline")
        }
        var isCollapsed = function(t) {
            return getAllCollapsed().indexOf(t) > -1
        }
        var getAllCollapsed = function() {
            return JSON.parse(localStorage.getItem(getStorageKey())) || []
        }
        var onBoardRendered = function() {
            for (var t = getAllCollapsed(), e = 0; e < t.length; e++)
                PJcollapse(t[e])
        }
        onBoardRendered();
        //点击任意位置关闭弹窗
        $(document).click(function() {
            closeDown();
        });
        $(document).on("click", ".task-board", function(t) {
            "A" != t.target.tagName && "IMG" != t.target.tagName && (window.location = $(this).data("task-url"))
        })
        $(document).on('click', '.b-iframe-pop', function() {
            var that = $(this);
            var them = window.top !== window.self ? window.top : window.self;
            var url = that.attr('href');

            if (!url) {
                layer.msg('请设置href参数');
                return false;
            }

            them.layer.open({
                type: 2
                ,title: '泳道管理'
                ,content: url
                ,maxmin: true
                ,area: ['80%', '80%']
                ,btn: ['关闭']
                ,btnAlign: 'c' //按钮居中
                ,fixed: false //不固定
                ,moveOut: true //true  可以拖出窗外  false 只能在窗内拖
                ,anim: 5 //出场动画 isOutAnim bool 关闭动画
                ,offset: 'auto' //['100px','100px'],//'auto',//初始位置  ['100px','100px'] t[ 上 左]
                ,shade: .7 //遮罩
                ,resize: true //是否允许拉伸
                ,move: '.layui-layer-title' // 默认".layui-layer-title",// 触发拖动的元素
                ,success: function(layero){
                    localStorage.setItem("layue_layer_open", 1);
                    layero.find('.layui-layer-min').remove();
                    layero.find('.layui-layer-close2').addClass('layui-layer-close1').removeClass('layui-layer-close2');
                }
                ,yes: function(){
                    window.location.reload();
                    them.layer.closeAll();
                    localStorage.removeItem("layue_layer_open");
                    return false;
                }
                ,cancel: function(){
                    window.location.reload();
                    them.layer.closeAll();
                    localStorage.removeItem("layue_layer_open");
                    return false;
                }
            });
            return false;
        });

        {if $pro.status != 2 }
        setInterval(function(){
            $.post("{:url('/projects.Produce/show')}?id={$pro.id}&timestamp={$pro.update_at}&op=check", function(res){
                if(res.code==1 && !localStorage.getItem("layue_layer_open")) window.location.reload(!0);
            });
        },10000);
        {/if}
    });
</script>
{/block}